#ifndef INCLUDE_PLAYERPROXY_H
#define INCLUDE_PLAYERPROXY_H

#include <map>

namespace PlayerCc
{
    class Position2dProxy;
    class MapProxy;
    class PlayerClient;
}

typedef std::map<int, PlayerCc::Position2dProxy*> DevIndexToProxyMap;

class PlayerProxy
{
public:
    PlayerProxy(void);
    ~PlayerProxy(void);

    static PlayerProxy& Instance();

    PlayerCc::PlayerClient& GetClient();
    PlayerCc::MapProxy& GetMap();

    void RefreshProxy();

    void PopulatePosProxy( int nProxyNum = 1 );
    void GetCurPosition( const int nDevIndex, double& dX, double& dY, double& dYaw );
    void GetCurVelocity( const int nDevIndex, double& dX, double& dY, double& dYaw );
    void GetLatestPosition( const int nDevIndex, double& dX, double& dY, double& dYaw );
    void GetLatestVelocity( const int nDevIndex, double& dX, double& dY, double& dYaw );
    void MoveTo( const int nDevIndex, const double dX, const double dY );
    bool ArrivedAt( const int nDevIndex, const double dX, const double dY );

private:
    DevIndexToProxyMap m_mapIdToPosProxys;
    PlayerCc::PlayerClient* m_pClient;
    PlayerCc::MapProxy* m_pMap;
};

#endif